import express from 'express'
import chalk from 'chalk'
const router = express.Router()

router.get('/:name',(req, res, next)=>{ //下载public里面的文件
    let { name } = req.params

    res.download(`public/${name}`,(err)=>{
        if(err)
            chalk.red(`err`)
        else
            console.log('successful!')
    })
})

export default router